/*
 * File:   Creature.h
 * Author: Elevator
 *
 * Created on July 14, 2013, 5:15 PM
 */

#ifndef DATA_CREATUREDEF_H
#define DATA_CREATUREDEF_H

#include <string>
#include "Common/Common.h"

#include "Detail.h"
#include "Rotor.h"
#include "Link.h"

namespace data {

	class CreatureDef {
	public:
		CreatureDef(
			std::string name,
			std::string description,
			std::string headId) :
		_name( name ),
		_description( description ),
		_headId( headId )
		{
			_details = new Vector<const Detail*>();
			_rotors = new Vector<const Rotor*>();
			_links = new Vector<Link>();
		}

		~CreatureDef()
		{
            delete _links;
            delete _rotors;
            delete _details;
		}

		inline const std::string GetName( ) const { return _name; }
		inline void SetName( std::string name ) { _name = name; }

		inline const std::string GetDescription( ) const { return _description; }
		inline void SetDescription( std::string description ) { _description = description; }

		inline const std::string GetHeadId( ) const { return _headId; }
		inline void SetHeadId( std::string headId ) { _headId = headId; }

		inline void AddDetail(const Detail* detail)	{ _details->Add(detail); }
		inline void RemoveDetail(const Detail* detail) { _details->Remove(detail); }
		inline const IIterable<const Detail*>* GetDetails( ) const { return _details; }

		inline void AddRotor(const Rotor* rotor) { _rotors->Add(rotor); }
		inline void RemoveRotor(const Rotor* rotor) { _rotors->Remove(rotor); }
		inline const IIterable<const Rotor*>* GetRotors( ) const { return _rotors; }

		inline void AddLink( Link link) { _links->Add(link); }
		inline void RemoveLink( Link link) { _links->Remove(link); }
		inline const IIterable<Link>* GetLinks( ) const { return _links; }

	private:
		std::string _name;
		std::string _description;
		std::string _headId;

		Vector<const Detail*>* _details;
		Vector<const Rotor*>* _rotors;
		Vector<Link>* _links;
	};
}
#endif	/* CREATUREDEF_H */
